﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NFinal.Common.Plugin.Exceptions
{
    /// <summary>
    /// 类型转换异常
    /// </summary>
    public class TypeConvertException : Exception
    {
        public TypeConvertException(string pluginName, Type instanceType, Type convertType) : base(GetMessage(pluginName,instanceType,convertType))
        {
        }
        private static string GetMessage(string pluginName, Type instanceType, Type convertType)
        {
            return $"插件{pluginName}中的类型{instanceType.FullName}与主项目中的类型{convertType.FullName}不一致,请确认类型是否错误!";
        }
    }
}
 